﻿@{
    ViewBag.Title = "Form";
    Layout = "~/Views/Shared/_Form.cshtml";
}
<script>
    var keyValue = $.request("keyValue");
    $(function () {
        //initControl();
        if (!!keyValue) {
            $.ajax({
                url: "/Article/ArticleType/GetFormJson",
                data: { keyValue: keyValue },
                dataType: "json",
                async: false,
                success: function (data) {
                    $("#form1").formSerialize(data);
                }
            });
        }
    });
    function initControl() {
        $("#F_OrganizeId").bindSelect({
            url: "/SystemManage/Organize/GetTreeSelectJson",
        });
    }
    function submitForm() {
        if (!$('#form1').formValid()) {
            return false;
        }
        $.submitForm({
            url: "/Article/ArticleType/SubmitForm?keyValue=" + keyValue,
            param: $("#form1").formSerialize(),
            success: function() {
                $.currentWindow().$("#gridList").trigger("reloadGrid");
            }
        });
    }
</script>

<form id="form1">
    <div style="padding-top: 20px; margin-right: 20px;">
        <table class="form">

            <tr>
                <th class="formTitle">分类代码</th>
                <td class="formValue">
                    <input id="F_Type" name="F_Type" type="text" class="form-control required number" placeholder="" />
                </td>
            </tr>
            <tr>
                <th class="formTitle">分类名称</th>
                <td class="formValue">
                    <input id="F_Name" name="F_Name" type="text" class="form-control required" placeholder="" />
                </td>
            </tr>
            <tr>
                <th class="formTitle">单篇文章</th>
                <td class="formValue">
                    <select id="F_IsSingle" name="F_IsSingle" class="form-control required">
                        <option value="false">否</option>
                        <option value="true">是</option>
                    </select>
                </td>
            </tr>
            <tr>
                <th class="formTitle">包含置顶</th>
                <td class="formValue">
                    <select id="F_HasTop" name="F_HasTop" class="form-control required">
                        <option value="false">否</option>
                        <option value="true">是</option>
                    </select>
                </td>
            </tr>
        </table>
    </div>
</form>